Micron Document




Copy (command)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
copy is a shell command for copying files.cite-ref-1[1]cite-ref-2[2]

Different implementations provide various capabilities, such as:

• Combining (concatenating) multiple files into a single file
• If multiple source files are specified before the path to an existing directory, then files are copied to the directory
• Support for text vs. binary data; for text, the command stops when it reaches an end-of-file (EOF) character; for binary, files are copied in their entirety; ignoring EOF
• In DOS, a file can be copied to or from a device. For example, copy path con outputs the file at path to the console, and copy con path copies text typed at the console to a file at path

Contents

DOS

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Implementations

The command is available in RT-11,cite-ref-3[3] OS/8,cite-ref-os8-handb-4-0[4] RSX-11,cite-ref-5[5] ISIS-II,cite-ref-6[6] iRMX 86,cite-ref-7[7] TOPS-10,cite-ref-8[8] TOPS-20,cite-ref-cmdref-9-0[9] OpenVMS,cite-ref-10[10] MetaComCo TRIPOS,cite-ref-11[11] HDOS,cite-ref-12[12] Z80-RIO,cite-ref-13[13] OS-9,cite-ref-14[14] DOS, FlexOS,cite-ref-15[15] 4690 OS,cite-ref-16[16] PC-MOS,cite-ref-17[17] HP MPE/iX,cite-ref-18[18] OS/2,cite-ref-19[19] Windows,cite-ref-20[20] ROM-DOS,cite-ref-21[21] ReactOS,cite-ref-22[22] SymbOS, DexOS, and 86-DOS.cite-ref-23[23]

Under IBM PC DOS/MS-DOS the command is available since version 1.cite-ref-runningmsdos-24-0[24]

Some shells provide a copy command with a different name. In Unix-based systems, the copy command is cp. In CP/M, the command is PIP. in OpenVOS, the command is copy_file.cite-ref-25[25]

DOS

The following copies existing file fromfile to path tofile.

copy fromfile tofile

A file can be copied to a device. The following sends a file to the printer on lpt1.

copy letter.txt lpt1

The following outputs to stdout, like the type command.

copy letter.txt con

The following concatenates the page# files into book.txt – like cat.

copy page1.txt+page2.txt book.txt

The command can copy files between drives.

The following uses text mode to copy text of the file; stopping when it reaches an EOF character.

copy /a doc1.txt + doc2.txt doc3.txt
copy /a *.txt doc3.txt

The following uses binary mode; concatenating files in their entirety; ignoring EOF characters.

copy /b image1.jpg + image2.jpg image3.jpg

See also

XCOPY – Shell command for copying files

References

cite-note-11. "Microsoft TechNet Copy article". 2009-09-11.
cite-note-22. citerefr-gheimerspanik1988Rügheimer, Hannes; Spanik, Christian (1988-09-14). AmigaDOS quick reference. Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive.
cite-note-33. "RT-11 HELP FILE". paleoferrosaurus.com. Archived from the original on 2018-07-17. Retrieved 2019-07-06.
cite-note-os8-handb-44. "Concise Command Language" (CCL)."OS/8 Handbook" (PDF). April 1974. Retrieved 2017-11-28.
cite-note-55. citerefjohn-f-pieper1987John F. Pieper (1987). RSX A Guide for Users (PDF). Digital Equipment Corporation. ISBN 0-932376-90-8. Retrieved 2020-09-19.
cite-note-66. ISIS II Users Guide
cite-note-77. "intel :: iRMX :: 146194-001 irmxR6Intro" – via Internet Archive.
cite-note-88. TOPS-10 Operating System Commands Manual (PDF). Digital Equipment Corporation. August 1980. Archived from the original (PDF) on 2020-08-09. Retrieved 2019-02-17.
cite-note-cmdref-99. "TOPS-20 Command manual" (PDF). Archived from the original (PDF) on 2020-08-09. Retrieved 2018-07-18.
cite-note-1010. "OpenVMS User's Manual". www.itec.suny.edu.
cite-note-1111. "Operating manual" (PDF). www.pagetable.com. Retrieved 2020-09-14.
cite-note-1212. citerefheath-companyHeath Company. "Software Reference Manual HDOS SYSTEM Chapter 2 General Operations" (PDF). Archived from the original (PDF) on 2017-08-07. Retrieved 2020-02-08.
cite-note-1313. Z80-RIO OPERATING SYSTEM USER'S MANUAL
cite-note-1414. citerefpaul-s-dayan1992Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
cite-note-1515. "FlexOS User's Guide" (PDF). www.bitsavers.org. 1986. Archived from the original (PDF) on 2010-08-08. Retrieved 2020-09-14.
cite-note-1616. [1]
cite-note-1717. "roelandjansen/pcmos386v501". GitHub. 2022-01-02.
cite-note-1818. "MPE/iX Command Reference Manual" (PDF). Archived from the original (PDF) on 2018-10-21. Retrieved 2018-10-21.
cite-note-1919. "OS/2 Commands: Copy". Archived from the original on 2019-04-14. Retrieved 2019-07-20.
cite-note-2020. "copy". docs.microsoft.com. 2023-02-03.
cite-note-2121. "Datalight ROM-DOS User's Guide" (PDF). www.datalight.com.
cite-note-2222. "reactos/reactos". GitHub. 2022-01-03.
cite-note-2323. 86-DOS - Disk Operating System for the 8086 - User's Manual (PDF). Version 0.3 (Preliminary ed.). Seattle, Washington, USA: Seattle Computer Products, Inc. 1980. Archived from the original (PDF) on 2019-07-14. Retrieved 2019-07-14. (59 pages)
cite-note-runningmsdos-2424. citerefwolverton2003Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
cite-note-2525. "OpenVOS Commands Reference Manual" (PDF). stratadoc.stratus.com. Retrieved 2020-09-14.

Further reading

• citerefwolverton1990Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
• citerefkathy-ivensbrian-proffit1993Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
• citereffrisch2001Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. O'Reilly. ISBN 978-0-596-00148-3.

External links

Wikibooks has a book on the topic of:

Guide to Windows Commands

• copy | Microsoft Docs
• Open source COPY implementation that comes with MS-DOS v2.0